//package listener;
//
//import javax.servlet.http.HttpSession;
//import javax.servlet.http.HttpSessionEvent;
//import javax.servlet.http.HttpSessionListener;
//
//public class HspHttpSessionListener implements HttpSessionListener {
//    @Override
//    public void sessionCreated(HttpSessionEvent httpSessionEvent) {
//        HttpSession session = httpSessionEvent.getSession();
//        session.setMaxInactiveInterval(30);
//        System.out.println("HspHttpSessionListener 监听到 session创建= "+
//                session.getId());
//    }
//
//    @Override
//    public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
//        HttpSession session = httpSessionEvent.getSession();
//        System.out.println("HspHttpSessionListener 监听到 session销毁= "+
//                session.getId());
//        System.out.println("用户id="+session.getId()+"离线");
//    }
//}
